Claim 5: There were 1,700 synapses at a density of one synapse per 1.13 μm3.
In [1]:
import numpy as np
import ndio.remote.neurodata as nd
from datetime import datetime
startTime = datetime.now()
oo = nd()
token = 'kasthuri2015_ramon_v1'
channel = 'synapses'
res = 3
pixel_dim = 0.024*0.024*0.030 #can get from LIMS
In [2]:
import ndio.ramon as ramon
synapse_ids = oo.get_ramon_ids(token, channel, ramon_type=ramon.RAMONSynapse)
# A priori known bounds for cylinders. Alternatively we could sweep over entire volume - this is more efficient.
# TODO: assume that all synapses are inside cylinders, which we know to be true - should do with manual masking or a
# RAMONId predicate query
xbox = [694,1794];
ybox = [1750, 2460];
zbox = [1004, 1379];
# These calls take about 60 seconds to execute
gcyl = oo.get_volume('kat11greencylinder','annotation', xbox[0], xbox[1], ybox[0], ybox[1], zbox[0], zbox[1], resolution = res)
rcyl = oo.get_volume('kat11redcylinder','annotation', xbox[0], xbox[1], ybox[0], ybox[1], zbox[0], zbox[1], resolution = res)
bcyl = oo.get_volume('kat11mojocylinder','annotation', xbox[0], xbox[1], ybox[0], ybox[1], zbox[0], zbox[1], resolution = res)
mask = (gcyl.cutout + rcyl.cutout + bcyl.cutout) > 0
mask_pixels = sum(sum(sum(mask)))
mask_volume = mask_pixels * pixel_dim
print 'Mask Pixels: ' + str(mask_pixels)
print 'Mask Volume: ' + str(mask_volume) + ' um^3'
print datetime.now() - startTime
In [4]:
print float(np.shape(synapse_ids)[0]) / mask_volume